package thinkinjava1.ch04;

/**
 * Mug 非静态实例的初始化
 * <p>
 * author: 顾博君 <br>
 * time:   2017/2/9 8:51 <br>
 * e-mail: gubojun@csii.com.cn <br>
 * </p>
 */
class Mug {
    Mug(int marker) {
        System.out.println("Mug(" + marker + ")");
    }

    void f(int marker) {
        System.out.println("f(" + marker + ")");
    }
}

public class Mugs {
    Mug c1;
    Mug c2;

    {
        c1 = new Mug(1);
        c2 = new Mug(2);
        System.out.println("c1 & c2 initialized");
    }

    public Mugs() {
        System.out.println("Mugs()");
    }

    public void mainRun() {
        System.out.println("inside main()");
        Mugs x = new Mugs();
    }
}